import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/entities/setting_data_entity.dart';
import 'package:finance_app/src/widgets/select/normal_check_box.dart';
import 'package:flutter/material.dart';

class GstInclusiveForm extends StatelessWidget {
  final bool isCheckInclusive;
  final VoidCallback onChangeInclusive;
  final SettingDataCurrency unit;
  final String gstInfo;
  final String total;

  const GstInclusiveForm(
      {Key key,
      this.isCheckInclusive,
      this.onChangeInclusive,
      @required this.unit,
      this.gstInfo,
      this.total})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        PressedOpacityButton(
          onPressed: onChangeInclusive,
          child: NormalCheckBox(
            title: S.current.gst_inclusive,
            isSelect: isCheckInclusive,
          ),
        ),
        Column(
          crossAxisAlignment: CrossAxisAlignment.end,
          children: [
            Text(
              '${unit.key} $gstInfo',
              style: TextStyle(
                color: aceDarkGrayColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w400,
                height: 1,
              ),
            ),
            SizedBox(
              height: getDp(18),
            ),
            Text(
              '${S.current.total}:${unit.key} $total',
              style: TextStyle(
                color: aceBlackColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w700,
                height: 1,
              ),
            ),
          ],
        )
      ],
    );
  }
}
